/**
 * Copyright 2009 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.code.sapien.dao;

import java.util.Collection;
import java.util.List;

import com.google.code.sapien.dao.jpa.CategoryAclJpaDAO;
import com.google.code.sapien.model.Category;
import com.google.code.sapien.model.CategoryAcl;
import com.google.code.sapien.model.Role;
import com.google.inject.ImplementedBy;

/**
 * Interface for Category access entry Data Access Objects.
 * @author Adam
 * @version $Id: CategoryAclDAO.java 23 2009-05-12 04:28:58Z a.ruggles $
 * 
 * Created on Mar 6, 2009 at 9:10:52 PM 
 */
@ImplementedBy(CategoryAclJpaDAO.class)
public interface CategoryAclDAO extends EntityDAO<CategoryAcl> {
	/**
	 * Returns an Acl Entry for a given role and category.
	 * @param category The category.
	 * @param role The role.
	 * @return A {@link com.google.code.sapien.model.CategoryAcl} or null if none exists.
	 */
	CategoryAcl get(Category category, Role role);

	/**
	 * Returns a list of category ACL entries for a category.
	 * @param category The category.
	 * @return A list of category ACL entries for a category.
	 */
	List<CategoryAcl> list(Category category);

	/**
	 * Returns a list of category ACL entries for a collection of roles.
	 * @param roles A collection of roles.
	 * @return A list of category ACL entries for a collection of roles.
	 */
	List<CategoryAcl> list(Collection<Role> roles);

	/**
	 * Returns a list of category ACL entries for a role.
	 * @param role The role.
	 * @return A list of category ACL entries for a role.
	 */
	List<CategoryAcl> list(Role role);

	/**
	 * Returns a list of category ACL entries that are marked for guest accounts. 
	 * @return A list of category ACL entries that are marked for guest accounts.
	 */
	List<CategoryAcl> listForGuests();

	/**
	 * Returns a list of category ACL entries that are marked for new user accounts. 
	 * @return A list of category ACL entries that are marked for new user accounts.
	 */
	List<CategoryAcl> listForNewUsers();
}
